﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Xml.Serialization;

namespace Sovigaz.DataProvider
{
    public partial class SovigazDbContext
    {
        public DbSet<Order> Orders { get; set; }
    }

    [Table("Orders")]
    public class Order : AuditableEntity
    {
        public Order()
        {
            Status = "N";
            Type = "G";
            OrderDate = DateTime.Now;
            DeliveryDate = DateTime.Now;
            PartnerID = 1;
        }

        [Key]
        public int OrderID { get; set; }

        public int PartnerID { get; set; }

        [NotMapped]
        public string PartnerName { get; set; }

        public string OrderCode { get; set; }

        public DateTime OrderDate { get; set; }

        public DateTime? DeliveryDate { get; set; }

        public string Status { get; set; }

        public string Type { get; set; }

        public string Description { get; set; }

        [XmlIgnore]
        [NotMapped]
        public ICollection<Partner> Partners { get; set; }

        [XmlIgnore]
        [NotMapped]
        public ICollection<OrderLine> OrderLines { get; set; }
    }

    public class OrderComplex
    {
        
        public int OrderID { get; set; }

        public int PartnerID { get; set; }

        public string PartnerName { get; set; }

        public string OrderCode { get; set; }

        public DateTime OrderDate { get; set; }

        public DateTime? DeliveryDate { get; set; }

        public string Status { get; set; }

        public string Type { get; set; }

        public string Description { get; set; }

        public bool IsDeleted { get; set; }
    }
}